From: Matthias Clasen Date: Mon, 8 Jun 2015 00:41:16 +0000 (-0400) Subject: entry: Hide popover when touching elsewhere X-Git-Tag: archive/raspbian/3.24.39-1+rpi1~1^2~65^2~39^2~6661 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=3e386e0abb79c1f291adf52879e22ff1dda7499e;p=gtk%2B3.0.git entry: Hide popover when touching elsewhere Otherwise, the popover becomes 'sticky' and hard-to-dismiss. --- diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index de4ec31e77..14328aca49 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -4506,24 +4506,29 @@ gtk_entry_multipress_gesture_pressed (GtkGestureMultiPress *gesture, priv->drag_start_y = y; } } - else if (!extend_selection) - { - gtk_editable_set_position (editable, tmp_pos); - } else { - gtk_entry_reset_im_context (entry); - - if (!have_selection) /* select from the current position to the clicked position */ - sel_start = sel_end = priv->current_pos; + gtk_entry_selection_bubble_popup_unset (entry); - if (tmp_pos > sel_start && tmp_pos < sel_end) + if (!extend_selection) { - /* Truncate current selection, but keep it as big as possible */ - if (tmp_pos - sel_start > sel_end - tmp_pos) - gtk_entry_set_positions (entry, sel_start, tmp_pos); - else - gtk_entry_set_positions (entry, tmp_pos, sel_end); + gtk_editable_set_position (editable, tmp_pos); + } + else + { + gtk_entry_reset_im_context (entry); + + if (!have_selection) /* select from the current position to the clicked position */ + sel_start = sel_end = priv->current_pos; + + if (tmp_pos > sel_start && tmp_pos < sel_end) + { + /* Truncate current selection, but keep it as big as possible */ + if (tmp_pos - sel_start > sel_end - tmp_pos) + gtk_entry_set_positions (entry, sel_start, tmp_pos); + else + gtk_entry_set_positions (entry, tmp_pos, sel_end); + } } }